-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not assume working_directory is github.workspace #4103
Conversation
Setting `working_directory` for ansible-lint action would fail due to hard-coded `.git`, introduced in commit 6f728e0, when fetching `.config/requirements-lock.txt`. This fix replaces `.git` with `${{ github.workspace }}/.git` to make `working_directory` argument work again.
Thanks for this PR. I was waiting for this but then I encountered this bug actions/runner#2058 |
Hi @ajfabbri, this change unfortunately breaks the use case of checking out a repository in a subdirectory of the workspace and running Example of workflow: https://github.com/RedHatInsights/ansible-collections-insights/blob/25a0213a4a955b44924c8439c3800f3f9157b76b/.github/workflows/ansible-lint.yml - name: Check out code
uses: actions/checkout@v4
with:
path: ansible_collections/redhat/insights
[...]
- name: Run ansible-lint
uses: ansible/ansible-lint@v24
with:
working_directory: ansible_collections/redhat/insights
Failure due this change: https://github.com/RedHatInsights/ansible-collections-insights/actions/runs/9351931654/job/25740530216 Personally, I think - uses: actions/checkout@v4
- name: Run ansible-lint
uses: ajfabbri/ansible-lint@main
with:
repository_subdirectory: iac What do you think? |
Due to recent changes in the ansible-lint action [1], the location of the .git directory is hardcoded (ignoring "working_directory"). Hence, for now bring back the .git symlink workaround. [1] ansible/ansible-lint#4103 Signed-off-by: Pino Toscano <[email protected]>
Thanks for the report. I think we should try to support your case (checkouts not in top-level workspace dir) as well as monorepo users (those that don't put ansible files at the top level of their repository). I'm not an expert here, but It seems like the source of the problem is the use of Two ideas to fix that
|
Due to recent changes in the ansible-lint action [1], the location of the .git directory is hardcoded (ignoring "working_directory"). Hence, for now bring back the .git symlink workaround. [1] ansible/ansible-lint#4103 Signed-off-by: Pino Toscano <[email protected]>
Setting
working_directory
for ansible-lint action would fail due to hard-coded.git
, introduced in commit 6f728e0, when fetching.config/requirements-lock.txt
.This fix replaces
.git
with${{ github.workspace }}/.git
to makeworking_directory
argument work again.Tested that this does fix my github action, i.e.:
Fixes #3938